﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

using SharedGenomics.Core;
using SharedGenomics.Core.Collections;

namespace SharedGenomics.Workbench.Annotations
{
    public class AnnotationRequestQueue
    {
        private AnnotationRequestPipeline _requestPipeline;
        private SignalledQueue<AnnotationRequestInfo> _requestQueue;

        public AnnotationRequestQueue(AnnotationRequestPipeline pipeline)
        {
            this._requestPipeline = pipeline;
            this._requestQueue = new SignalledQueue<AnnotationRequestInfo>(r => this._requestPipeline.Execute(r), 3);
        }

        public virtual void QueueRequest(AnnotationRequestInfo requestInfo)
        {
            requestInfo.ThrowIfNull("requestInfo");
            this._requestQueue.Enqueue(requestInfo);
        }

        public virtual void Stop()
        {
        }
    }
}